var a = getApp();

Page({
    data: {
        car:'',
        xiugai:'',
        toabc: "",
        classes: [],
        max_height: 667
    },
    onLoad: function(cc) {
      console.log(cc)
        var t = wx.getSystemInfoSync(), e = this;
        e.setData({
          xiugai:cc.xiugai,
          car:cc.car
        })
        a.util.request({
            url: "entry/wxapp/Api",
            data: {
                m: "monai_market",
                r: "sale.index.carsbrand"
            },
            cachetime: "0",
            success: function(a) {
                console.log(a), e.setData({
                    classes: a.data.data,
                    max_height: t.windowHeight
                });
            }
        });
     
    },
    retoabc: function(a) {
        this.setData({
            toabc: a.currentTarget.dataset.abc
        });
    },
    backid: function(t) {
        a.util.navigateBack({
            data: {
                brandid: t.currentTarget.dataset.ids,
                brandname: t.currentTarget.dataset.name,
                brand_status: 1
            }
        });
    },
    carVehicels:function(e){
      console.log(e)
      var tt = this
      var id = e.currentTarget.dataset.ids
      var name = e.currentTarget.dataset.name
      if(tt.data.xiugai == 5){
        var pages = getCurrentPages();
        var currPage = pages[pages.length - 1];   //当前页面
        var prevPage = pages[pages.length - 2];  //上一个页面
        prevPage.setData({
          brandid:id,
          brandname: name,
          brand_status: '1',
          shuju:true
        });
        wx.navigateBack({ delta: 1 });
      }else{
        wx.navigateTo({
          url: '../carVehicels/carVehicels?id=' + id + "&name=" + name + "&xiugai=" + tt.data.xiugai + "&car=" + tt.data.car
        })
      }
    }
});